<%@ page contentType="text/html;charset=utf-8" language="java"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<html:html>
<head>
<script type="text/javascript" src="./Bs_Misc.lib.js"></script>
<script type="text/javascript" src="./Bs_DataGrid.class.js"></script>
<link rel='stylesheet' href='../styles/stylewang.css'>	
<link rel='stylesheet' href='../jobSchedule/style1.css'>		
<title>CGProject</title>
</head>
<script type="text/javascript">
	var data = new Array();
	var data2 = new Array();
	var data3 = new Array();
	var data4 = new Array();
</script>

<logic:iterate id="element1" name="Link_ElementTasks">

<script type="text/javascript">
  var dataString = "<bean:write name="element1" />";
	dataString = dataString.replace(/HasInput/g,"<table width='100%' height='100%' bgcolor='#cecece'><tr><td class='bsDg_table'><bean:message key='HasInput'/></td></tr></table>");
	dataString = dataString.replace(/HasAssigned/g,"<table width='100%' height='100%' bgcolor='#eafbcc'><tr><td class='bsDg_table'><bean:message key='HasAssigned'/></td></tr></table>");
	dataString = dataString.replace(/WaitingConfirm/g,"<table width='100%' height='100%' bgcolor='#fef0dd'><tr><td class='bsDg_table'><bean:message key='WaitingConfirm'/></td></tr></table>");
	dataString = dataString.replace(/ConfirmNotPassed/g,"<table width='100%' height='100%' bgcolor='#93a491'><tr><td class='bsDg_table'><bean:message key='ConfirmNotPassed'/></td></tr></table>");
	dataString = dataString.replace(/ConfirmPassed/g,"<table width='100%' height='100%' bgcolor='#f0e2f9'><tr><td class='bsDg_table'><bean:message key='ConfirmPassed'/></td></tr></table>");
	dataString = dataString.replace(/Finished/g,"<table width='100%' height='100%' bgcolor='#fbf8cc'><tr><td class='bsDg_table'><bean:message key='Finished'/></td></tr></table>");
	dataString = dataString.replace(/StandBy/g,"<table width='100%' height='100%' bgcolor='#c3dbff'><tr><td class='bsDg_table'><bean:message key='StandBy'/></td></tr></table>");
	dataString = dataString.replace(/IsDoing/g,"<table width='100%' height='100%' bgcolor='#d43e1b'><tr><td class='bsDg_table'><bean:message key='IsDoing'/></td></tr></table>");
	dataString = dataString.replace(/PAUSE/g,"<table width='100%' height='100%' bgcolor='#ff001b'><tr><td class='bsDg_table'><bean:message key='PAUSE'/></td></tr></table>");
	data[data.length] = dataString.split("$");

</script>
</logic:iterate>
<logic:iterate id="element2" name="Link_ShotTasks">

<script type="text/javascript">
  var dataString2 = "<bean:write name="element2" />";

	dataString2 = dataString2.replace(/HasInput/g,"<table width='100%' height='100%' bgcolor='#cecece'><tr><td class='bsDg_table'><bean:message key='HasInput'/></td></tr></table>");
	dataString2 = dataString2.replace(/HasAssigned/g,"<table width='100%' height='100%' bgcolor='#eafbcc'><tr><td class='bsDg_table'><bean:message key='HasAssigned'/></td></tr></table>");
	dataString2 = dataString2.replace(/WaitingConfirm/g,"<table width='100%' height='100%' bgcolor='#fef0dd'><tr><td class='bsDg_table'><bean:message key='WaitingConfirm'/></td></tr></table>");
	dataString2 = dataString2.replace(/ConfirmNotPassed/g,"<table width='100%' height='100%' bgcolor='#93a491'><tr><td class='bsDg_table'><bean:message key='ConfirmNotPassed'/></td></tr></table>");
	dataString2 = dataString2.replace(/ConfirmPassed/g,"<table width='100%' height='100%' bgcolor='#f0e2f9'><tr><td class='bsDg_table'><bean:message key='ConfirmPassed'/></td></tr></table>");
	dataString2 = dataString2.replace(/Finished/g,"<table width='100%' height='100%' bgcolor='#fbf8cc'><tr><td class='bsDg_table'><bean:message key='Finished'/></td></tr></table>");
	dataString2 = dataString2.replace(/StandBy/g,"<table width='100%' height='100%' bgcolor='#c3dbff'><tr><td class='bsDg_table'><bean:message key='StandBy'/></td></tr></table>");
	dataString2 = dataString2.replace(/IsDoing/g,"<table width='100%' height='100%' bgcolor='#d43e1b'><tr><td class='bsDg_table'><bean:message key='IsDoing'/></td></tr></table>");
	dataString2 = dataString2.replace(/PAUSE/g,"<table width='100%' height='100%' bgcolor='#ff001b'><tr><td class='bsDg_table'><bean:message key='PAUSE'/></td></tr></table>");
  data2[data2.length] = dataString2.split("$");

</script>
</logic:iterate>



<logic:iterate id="element3" name="Link_FinishedElementTasks">

<script type="text/javascript">
  var dataString3 = "<bean:write name="element3" />";
  data3[data3.length] = dataString3.split("$");

</script>
</logic:iterate>


<logic:iterate id="element4" name="Link_FinishedShotTasks">

<script type="text/javascript">
  var dataString4 = "<bean:write name="element4" />";
  data4[data4.length] = dataString4.split("$");

</script>
</logic:iterate>

<script type="text/javascript">

function init() {
  myGrid = new Bs_DataGrid('myGrid');
  myGrid.buttonsDefaultPath = '../image/datagrid/';
  myGrid.bHeaderFix = true;
  myGrid.rowClick = new Object( {key:0, baseUrl:'./taskdetail.do?TYPE=element&ID='} );
  var header = new Array();
  var headerString = "<bean:write name="ElementHeader" />";  
  header = headerString.split("$");
  myGrid.useNoDataText=true;
  myGrid.setHeaderProps(header);
  myGrid.setData(data);
  myGrid.drawInto('myGridDiv');
  
  
  myGrid2 = new Bs_DataGrid('myGrid');
  myGrid2.buttonsDefaultPath = '../image/datagrid/';
  myGrid2.bHeaderFix = false;
  myGrid2.rowClick = new Object( {key:0, baseUrl:'./taskdetail.do?TYPE=shot&ID='} );
  var header2 = new Array();
  var headerString2 = "<bean:write name="ShotHeader" />";  
  header2 = headerString2.split("$");
  myGrid2.useNoDataText=true;
  myGrid2.setHeaderProps(header2);
  myGrid2.setData(data2);
  myGrid2.drawInto('myGridDiv2');
  
  myGrid3 = new Bs_DataGrid('myGrid');
  myGrid3.buttonsDefaultPath = '../image/datagrid/';
  myGrid3.bHeaderFix = false;
  myGrid3.rowClick = new Object( {key:0, baseUrl:'./taskdetail.do?TYPE=element&ID='} );
  var header3 = new Array();
  var headerString3 = "ID$Element";  
  header3 = headerString3.split("$");
  myGrid3.useNoDataText=true;
  myGrid3.setHeaderProps(header3);
  myGrid3.setData(data3);
  myGrid3.drawInto('myGridDiv3');
  
  myGrid4 = new Bs_DataGrid('myGrid');
  myGrid4.buttonsDefaultPath = '../image/datagrid/';
  myGrid4.bHeaderFix = false;
  myGrid3.rowClick = new Object( {key:0, baseUrl:'./taskdetail.do?TYPE=shot&ID='} );
  var header4 = new Array();
  var headerString4 = "ID$Shot";  
  header4 = headerString4.split("$");
  myGrid4.useNoDataText=true;
  myGrid4.setHeaderProps(header4);
  myGrid4.setData(data4);
  myGrid4.drawInto('myGridDiv4');
  
  
  
}
</script>

<body onLoad="init();">


<div style="  overflow-y:   scroll;   height:   35%;   width:   100%;">
<div id="myGridDiv"></div>
<div id="myGridDiv2"></div>
</div>

			<table cellspacing="0"  width="100%" height="65%" align="left" > 
						
						
				<tr>
							<td width="20%" valign="top">
								
							<table width="100%" cellspacing="0">
								<tr>
									<td align="left" valign="top" id="onlybt"> 
										&nbsp;<bean:message key="task.hasfinished"/>									</td>
								</tr>
								<tr>
								  <td align="left" valign="top" id="rightcenter"><div id="myGridDiv3"></div></td>
							  </tr>
								<tr>
								  <td align="left" valign="top" id="rightcenter"><div id="myGridDiv4"></div></td>
							  </tr>
								<tr>								</tr>
						       <tr><td>
         <table width="100%" border="0" cellspacing="0" cellpadding="0" id="tdtop">
            <tr>
              <td></td>
             </tr>
         </table></td>
        </tr>
							</table>
				  </td>
							
							<td height="100%" width="80%"><iframe name="D12" marginwidth="0" marginheight="0" width="100%" border="0" frameborder="0" height="100%" <logic:notEmpty name="CurrentTask">src="./taskdetail.do?ID=<bean:write name="CurrentTask" property="taskId"/>"</logic:notEmpty> scrolling="yes">
								</iframe></td>
						
				</tr>
			</table>
</body>
</html:html>

		
